var dom = document.getElementById("main.2");
var myChart = echarts.init(dom);
option = {
    tooltip : {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },

    visualMap: {
        show: false,
        min: 80,
        max: 600,
        inRange: {
            colorLightness: [0, 1]
        }
    },
    series : [
        {
            name:'访问来源',
            type:'pie',
            radius : '40%',
            center: ['55%', '49%'],
            data:[
                {value:56, name:'QQ'},
                {value:312, name:'网易云音乐'},
                {value:10, name:'支付宝'},
                {value:34, name:'微信'},
                {value:233, name:'bilibili'},
                {value:12, name:'谷歌浏览器'},
                {value:2, name:'饿了么'}
            ].sort(function (a, b) { return a.value - b.value; }),
            roseType: 'radius',
            label: {
                normal: {
                    textStyle: {
                        color: 'rgba(0, 0, 0, 1)'
                    }
                }
            },
            labelLine: {
                normal: {
                    lineStyle: {
                        color: 'rgba(0, 0, 0, 1)'
                    },
                    smooth: 0.2,
                    length: 10,
                    length2: 20
                }
            },
            

            animationType: 'scale',
            animationEasing: 'elasticOut',
            animationDelay: function (idx) {
                return Math.random() * 200;
            }
        }
    ]
};
myChart.setOption(option, true);